home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Resources / Chat & Communication / Digsby build 37 / digsby_setup.exe / lib / social / network.pyo (.txt) < prev   
Python Compiled Bytecode  |  2008-10-13  |  5KB  |  115 lines

  1. # Source Generated with Decompyle++
  2. # File: in.pyo (Python 2.5)
  3.  
  4. import cPickle
  5. import logging
  6. log = logging.getLogger('social.network')
  7. from util import try_this
  8. from common import AccountBase, profile, UpdateMixin, FromNetMixin, pref
  9.  
  10. class SocialNetwork(UpdateMixin, AccountBase, FromNetMixin):
  11.     filters = { }
  12.     header_funcs = []
  13.     timer = Null
  14.     
  15.     def __init__(self, enabled = True, **options):
  16.         AccountBase.__init__(self, **options)
  17.         UpdateMixin.__init__(self, **options)
  18.         FromNetMixin.__init__(self, **options)
  19.         self.enabled = enabled
  20.         self._dirty_error = True
  21.  
  22.     
  23.     def dirty(self):
  24.         return self._dirty
  25.  
  26.     dirty = property(dirty)
  27.     
  28.     def display_name(self):
  29.         return (try_this,)((lambda : getattr(self, pref('social.display_attr'))), self.username)
  30.  
  31.     display_name = property(display_name)
  32.     
  33.     def _decryptedpw(self):
  34.         return profile.plain_pw(self.password)
  35.  
  36.     
  37.     def update_info(self, **info):
  38.         self._dirty_error = True
  39.         for k, v in info.iteritems():
  40.             setattr(self, k, v)
  41.         
  42.         self.notify()
  43.         profile.update_account(self)
  44.  
  45.     
  46.     def get_options(self):
  47.         opts = UpdateMixin.get_options(self)
  48.         opts.pop('updatefreq', None)
  49.         return opts
  50.  
  51.     
  52.     def icon(self):
  53.         skin = skin
  54.         import gui
  55.         try_this = try_this
  56.         import util
  57.         return (None, try_this)((lambda : skin.get('serviceicons.%s' % self.protocol)), None)
  58.  
  59.     icon = property(icon)
  60.     
  61.     def error_link(self):
  62.         reason = self.Reasons
  63.         linkref = {
  64.             reason.BAD_PASSWORD: (('Edit Account',), (lambda : profile.account_manager.edit(self))),
  65.             reason.CONN_FAIL: (('Retry',), (lambda : self.Connect())),
  66.             reason.OTHER_USER: (('Reconnect',), (lambda : self.update_now())),
  67.             reason.CONN_LOST: (('Retry',), (lambda : self.update_now())),
  68.             reason.WILL_RECONNECT: (('Retry',), (lambda : self.update_now())),
  69.             reason.NONE: None }
  70.         if self.offline_reason in linkref:
  71.             return linkref[self.offline_reason]
  72.         else:
  73.             log.debug("Couldn't find offline reason %r in linkref dictionary. Returning None for error_link", self.offline_reason)
  74.             return None
  75.  
  76.     
  77.     def service(self):
  78.         raise NotImplementedError
  79.  
  80.     service = property(service)
  81.     
  82.     def protocol(self):
  83.         raise NotImplementedError
  84.  
  85.     protocol = property(protocol)
  86.     
  87.     def Connect(self, *a, **k):
  88.         raise NotImplementedError
  89.  
  90.     
  91.     def Disconnect(self, *a, **k):
  92.         raise NotImplementedError
  93.  
  94.     
  95.     def disconnect(self, *a, **k):
  96.         raise NotImplementedError
  97.  
  98.     
  99.     def observe_count(self, callback):
  100.         raise NotImplementedError
  101.  
  102.     
  103.     def observe_state(self, callback):
  104.         raise NotImplementedError
  105.  
  106.     
  107.     def unobserve_count(self, callback):
  108.         raise NotImplementedError
  109.  
  110.     
  111.     def unobserve_state(self, callback):
  112.         raise NotImplementedError
  113.  
  114.  
  115.